/* spearl/include/spearl/compiler.h 
 * 
 * This file is part of spearl. 
 * 
 * Spearl is free software: you can redistribute it and/or modify 
 * it under the terms of the GNU General Public License as published by 
 * the Free Software Foundation, either version 3 of the License, or 
 * (at your option) any later version. 
 * 
 * Spearl is distributed in the hope that it will be useful, 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
 * GNU General Public License for more details. 
 * 
 * You should have received a copy of the GNU General Public License 
 * along with spearl. If not, see <https://www.gnu.org/licenses/>
 */ 




#ifndef __SPEARL_COMPILER_H
#define __SPEARL_COMPILER_H

/* actually this is useless because we only want to support gcc :-) */

#ifndef __GNUC__
#error "GCC required. "
#endif

#define toboolean(c) 		(!!(c)) __locally

#define likely(c) 		__builtin_expect(toboolean(c), 1) __locally
#define unlikely(c) 		__builtin_expect(toboolean(c), 0) __locally

#define __unused 		__attribute__ ((unused))

#endif

